<?
  include('lib/JsHttpRequest/JsHttpRequest.php');
  include('includes/common.php');
  include_once ('ws/xml_response_process.php');

  $JsHttpRequest =& new JsHttpRequest("UTF-8");

  $alert_msg = "";

  $request = new WSRequest(XML_API, "ITEM_AVAILABILITY", POSTGET("item"));
  $item= new XMLprocess($request->wsanswer);
 

    
  $open_calendar = 0;  
  if($item->Status=="OK")
  {

       $adult_price=$item->AdultPrice;
       $child_price=$item->ChildPrice;
      
        if ($item->Warning!="")
            {$alert =1; $alert_msg=$item->Warning;}
        else
            {$alert =0; $alert_msg="";}

	  $GLOBALS['_RESULT'] = array(
                "status"        => "ok",
                "adult"         => "$".$adult_price,
                "child"         => "$".$child_price,
                "adult_price"   => $adult_price,
                "child_price"   => $child_price,
                "alert"         => $alert,
                "alert_msg"     => $alert_msg
	  );
          //var_dump($GLOBALS['_RESULT']);
	  exit(0);
       	
  }

  $GLOBALS['_RESULT'] = array (
            	"status"        => "error",
                "error_msg"     => $item->ErrorMessage,
  		"open_calendar" => 1
  );
  exit(0);  
?>